\(\int \tan ^4(x) \sqrt {a+a \tan ^2(x)} \, dx\) [257]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 17, antiderivative size = 54 \[ \int \tan ^4(x) \sqrt {a+a \tan ^2(x)} \, dx=\frac {3}{8} \text {arctanh}(\sin (x)) \cos (x) \sqrt {a \sec ^2(x)}-\frac {3}{8} \sqrt {a \sec ^2(x)} \tan (x)+\frac {1}{4} \sqrt {a \sec ^2(x)} \tan ^3(x) \]

[Out]

3/8*arctanh(sin(x))*cos(x)*(a*sec(x)^2)^(1/2)-3/8*(a*sec(x)^2)^(1/2)*tan(x)+1/4*(a*sec(x)^2)^(1/2)*tan(x)^3

Rubi [A] (verified)

Time = 0.13 (sec) , antiderivative size = 54, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.235, Rules used = {3738, 4210, 2691, 3855} \[ \int \tan ^4(x) \sqrt {a+a \tan ^2(x)} \, dx=\frac {3}{8} \cos (x) \sqrt {a \sec ^2(x)} \text {arctanh}(\sin (x))+\frac {1}{4} \tan ^3(x) \sqrt {a \sec ^2(x)}-\frac {3}{8} \tan (x) \sqrt {a \sec ^2(x)} \]

[In]

Int[Tan[x]^4*Sqrt[a + a*Tan[x]^2],x]

[Out]

(3*ArcTanh[Sin[x]]*Cos[x]*Sqrt[a*Sec[x]^2])/8 - (3*Sqrt[a*Sec[x]^2]*Tan[x])/8 + (Sqrt[a*Sec[x]^2]*Tan[x]^3)/4

Rule 2691

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(a*Sec[e +
 f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Dist[b^2*((n - 1)/(m + n - 1)), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 3738

Int[(u_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(a*sec[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a, b]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4210

Int[(u_.)*((b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = FreeFactors[Sec[e + f*x], x]}, Di
st[(b*ff^n)^IntPart[p]*((b*Sec[e + f*x]^n)^FracPart[p]/(Sec[e + f*x]/ff)^(n*FracPart[p])), Int[ActivateTrig[u]
*(Sec[e + f*x]/ff)^(n*p), x], x]] /; FreeQ[{b, e, f, n, p}, x] &&  !IntegerQ[p] && IntegerQ[n] && (EqQ[u, 1] |
| MatchQ[u, ((d_.)*(trig_)[e + f*x])^(m_.) /; FreeQ[{d, m}, x] && MemberQ[{sin, cos, tan, cot, sec, csc}, trig
]])

Rubi steps \begin{align*} \text {integral}& = \int \sqrt {a \sec ^2(x)} \tan ^4(x) \, dx \\ & = \left (\cos (x) \sqrt {a \sec ^2(x)}\right ) \int \sec (x) \tan ^4(x) \, dx \\ & = \frac {1}{4} \sqrt {a \sec ^2(x)} \tan ^3(x)-\frac {1}{4} \left (3 \cos (x) \sqrt {a \sec ^2(x)}\right ) \int \sec (x) \tan ^2(x) \, dx \\ & = -\frac {3}{8} \sqrt {a \sec ^2(x)} \tan (x)+\frac {1}{4} \sqrt {a \sec ^2(x)} \tan ^3(x)+\frac {1}{8} \left (3 \cos (x) \sqrt {a \sec ^2(x)}\right ) \int \sec (x) \, dx \\ & = \frac {3}{8} \text {arctanh}(\sin (x)) \cos (x) \sqrt {a \sec ^2(x)}-\frac {3}{8} \sqrt {a \sec ^2(x)} \tan (x)+\frac {1}{4} \sqrt {a \sec ^2(x)} \tan ^3(x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.09 (sec) , antiderivative size = 32, normalized size of antiderivative = 0.59 \[ \int \tan ^4(x) \sqrt {a+a \tan ^2(x)} \, dx=\frac {1}{8} \sqrt {a \sec ^2(x)} \left (3 \text {arctanh}(\sin (x)) \cos (x)-3 \tan (x)+2 \tan ^3(x)\right ) \]

[In]

Integrate[Tan[x]^4*Sqrt[a + a*Tan[x]^2],x]

[Out]

(Sqrt[a*Sec[x]^2]*(3*ArcTanh[Sin[x]]*Cos[x] - 3*Tan[x] + 2*Tan[x]^3))/8

Maple [A] (verified)

Time = 0.14 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.04

method result size
derivativedivides \(-\frac {5 \sqrt {a +a \tan \left (x \right )^{2}}\, \tan \left (x \right )}{8}+\frac {3 \sqrt {a}\, \ln \left (\sqrt {a}\, \tan \left (x \right )+\sqrt {a +a \tan \left (x \right )^{2}}\right )}{8}+\frac {\tan \left (x \right ) \left (a +a \tan \left (x \right )^{2}\right )^{\frac {3}{2}}}{4 a}\) \(56\)
default \(-\frac {5 \sqrt {a +a \tan \left (x \right )^{2}}\, \tan \left (x \right )}{8}+\frac {3 \sqrt {a}\, \ln \left (\sqrt {a}\, \tan \left (x \right )+\sqrt {a +a \tan \left (x \right )^{2}}\right )}{8}+\frac {\tan \left (x \right ) \left (a +a \tan \left (x \right )^{2}\right )^{\frac {3}{2}}}{4 a}\) \(56\)
risch \(\frac {i \sqrt {\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}}\, \left (5 \,{\mathrm e}^{6 i x}-3 \,{\mathrm e}^{4 i x}+3 \,{\mathrm e}^{2 i x}-5\right )}{4 \left ({\mathrm e}^{2 i x}+1\right )^{3}}-\frac {3 \sqrt {\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}}\, \ln \left ({\mathrm e}^{i x}-i\right ) \cos \left (x \right )}{4}+\frac {3 \sqrt {\frac {a \,{\mathrm e}^{2 i x}}{\left ({\mathrm e}^{2 i x}+1\right )^{2}}}\, \ln \left ({\mathrm e}^{i x}+i\right ) \cos \left (x \right )}{4}\) \(117\)

[In]

int((a+a*tan(x)^2)^(1/2)*tan(x)^4,x,method=_RETURNVERBOSE)

[Out]

-5/8*(a+a*tan(x)^2)^(1/2)*tan(x)+3/8*a^(1/2)*ln(a^(1/2)*tan(x)+(a+a*tan(x)^2)^(1/2))+1/4*tan(x)*(a+a*tan(x)^2)
^(3/2)/a

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.04 \[ \int \tan ^4(x) \sqrt {a+a \tan ^2(x)} \, dx=\frac {1}{8} \, \sqrt {a \tan \left (x\right )^{2} + a} {\left (2 \, \tan \left (x\right )^{3} - 3 \, \tan \left (x\right )\right )} + \frac {3}{16} \, \sqrt {a} \log \left (2 \, a \tan \left (x\right )^{2} + 2 \, \sqrt {a \tan \left (x\right )^{2} + a} \sqrt {a} \tan \left (x\right ) + a\right ) \]

[In]

integrate((a+a*tan(x)^2)^(1/2)*tan(x)^4,x, algorithm="fricas")

[Out]

1/8*sqrt(a*tan(x)^2 + a)*(2*tan(x)^3 - 3*tan(x)) + 3/16*sqrt(a)*log(2*a*tan(x)^2 + 2*sqrt(a*tan(x)^2 + a)*sqrt
(a)*tan(x) + a)

Sympy [F]

\[ \int \tan ^4(x) \sqrt {a+a \tan ^2(x)} \, dx=\int \sqrt {a \left (\tan ^{2}{\left (x \right )} + 1\right )} \tan ^{4}{\left (x \right )}\, dx \]

[In]

integrate((a+a*tan(x)**2)**(1/2)*tan(x)**4,x)

[Out]

Integral(sqrt(a*(tan(x)**2 + 1))*tan(x)**4, x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 860 vs. \(2 (42) = 84\).

Time = 0.71 (sec) , antiderivative size = 860, normalized size of antiderivative = 15.93 \[ \int \tan ^4(x) \sqrt {a+a \tan ^2(x)} \, dx=\text {Too large to display} \]

[In]

integrate((a+a*tan(x)^2)^(1/2)*tan(x)^4,x, algorithm="maxima")

[Out]

-1/16*(4*(5*sin(7*x) - 3*sin(5*x) + 3*sin(3*x) - 5*sin(x))*cos(8*x) - 40*(2*sin(6*x) + 3*sin(4*x) + 2*sin(2*x)
)*cos(7*x) - 16*(3*sin(5*x) - 3*sin(3*x) + 5*sin(x))*cos(6*x) + 24*(3*sin(4*x) + 2*sin(2*x))*cos(5*x) + 24*(3*
sin(3*x) - 5*sin(x))*cos(4*x) - 3*(2*(4*cos(6*x) + 6*cos(4*x) + 4*cos(2*x) + 1)*cos(8*x) + cos(8*x)^2 + 8*(6*c
os(4*x) + 4*cos(2*x) + 1)*cos(6*x) + 16*cos(6*x)^2 + 12*(4*cos(2*x) + 1)*cos(4*x) + 36*cos(4*x)^2 + 16*cos(2*x
)^2 + 4*(2*sin(6*x) + 3*sin(4*x) + 2*sin(2*x))*sin(8*x) + sin(8*x)^2 + 16*(3*sin(4*x) + 2*sin(2*x))*sin(6*x) +
 16*sin(6*x)^2 + 36*sin(4*x)^2 + 48*sin(4*x)*sin(2*x) + 16*sin(2*x)^2 + 8*cos(2*x) + 1)*log(cos(x)^2 + sin(x)^
2 + 2*sin(x) + 1) + 3*(2*(4*cos(6*x) + 6*cos(4*x) + 4*cos(2*x) + 1)*cos(8*x) + cos(8*x)^2 + 8*(6*cos(4*x) + 4*
cos(2*x) + 1)*cos(6*x) + 16*cos(6*x)^2 + 12*(4*cos(2*x) + 1)*cos(4*x) + 36*cos(4*x)^2 + 16*cos(2*x)^2 + 4*(2*s
in(6*x) + 3*sin(4*x) + 2*sin(2*x))*sin(8*x) + sin(8*x)^2 + 16*(3*sin(4*x) + 2*sin(2*x))*sin(6*x) + 16*sin(6*x)
^2 + 36*sin(4*x)^2 + 48*sin(4*x)*sin(2*x) + 16*sin(2*x)^2 + 8*cos(2*x) + 1)*log(cos(x)^2 + sin(x)^2 - 2*sin(x)
 + 1) - 4*(5*cos(7*x) - 3*cos(5*x) + 3*cos(3*x) - 5*cos(x))*sin(8*x) + 20*(4*cos(6*x) + 6*cos(4*x) + 4*cos(2*x
) + 1)*sin(7*x) + 16*(3*cos(5*x) - 3*cos(3*x) + 5*cos(x))*sin(6*x) - 12*(6*cos(4*x) + 4*cos(2*x) + 1)*sin(5*x)
 - 24*(3*cos(3*x) - 5*cos(x))*sin(4*x) + 12*(4*cos(2*x) + 1)*sin(3*x) - 48*cos(3*x)*sin(2*x) + 80*cos(x)*sin(2
*x) - 80*cos(2*x)*sin(x) - 20*sin(x))*sqrt(a)/(2*(4*cos(6*x) + 6*cos(4*x) + 4*cos(2*x) + 1)*cos(8*x) + cos(8*x
)^2 + 8*(6*cos(4*x) + 4*cos(2*x) + 1)*cos(6*x) + 16*cos(6*x)^2 + 12*(4*cos(2*x) + 1)*cos(4*x) + 36*cos(4*x)^2
+ 16*cos(2*x)^2 + 4*(2*sin(6*x) + 3*sin(4*x) + 2*sin(2*x))*sin(8*x) + sin(8*x)^2 + 16*(3*sin(4*x) + 2*sin(2*x)
)*sin(6*x) + 16*sin(6*x)^2 + 36*sin(4*x)^2 + 48*sin(4*x)*sin(2*x) + 16*sin(2*x)^2 + 8*cos(2*x) + 1)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.89 \[ \int \tan ^4(x) \sqrt {a+a \tan ^2(x)} \, dx=\frac {1}{8} \, \sqrt {a \tan \left (x\right )^{2} + a} {\left (2 \, \tan \left (x\right )^{2} - 3\right )} \tan \left (x\right ) - \frac {3}{8} \, \sqrt {a} \log \left ({\left | -\sqrt {a} \tan \left (x\right ) + \sqrt {a \tan \left (x\right )^{2} + a} \right |}\right ) \]

[In]

integrate((a+a*tan(x)^2)^(1/2)*tan(x)^4,x, algorithm="giac")

[Out]

1/8*sqrt(a*tan(x)^2 + a)*(2*tan(x)^2 - 3)*tan(x) - 3/8*sqrt(a)*log(abs(-sqrt(a)*tan(x) + sqrt(a*tan(x)^2 + a))
)

Mupad [F(-1)]

Timed out. \[ \int \tan ^4(x) \sqrt {a+a \tan ^2(x)} \, dx=\int {\mathrm {tan}\left (x\right )}^4\,\sqrt {a\,{\mathrm {tan}\left (x\right )}^2+a} \,d x \]

[In]

int(tan(x)^4*(a + a*tan(x)^2)^(1/2),x)

[Out]

int(tan(x)^4*(a + a*tan(x)^2)^(1/2), x)